package main

import "fmt"

func numberOfSteps(num int) int {
	//num是奇数
	result := 0
	for num != 0 {
		if num&1 == 1 {
			num = num ^ 1
		} else {
			num >>= 1
		}
		result += 1
	}
	return result
}

func main() {
	a := numberOfSteps(7)
	fmt.Println(a)
}
